﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace PrimaryStudentPainProgram
{
    public partial class ParentForm : Form
    {
        MainForm mainForm;
        ResultForm resultForm;

        public int MAX_NUM = 50;
        public int INTERVAL = 20;

        public List<FixPair> wrongList = new List<FixPair>();

        public ParentForm()
        {
            InitializeComponent();
            mainForm = new MainForm(this);
            resultForm = new ResultForm(this);
            mainForm.MdiParent = this;
            resultForm.MdiParent = this;
            mainForm.Show();
            resultForm.Hide();
        }

        public void finish(Form form)
        {
            form.Close();
            resultForm.update();
            resultForm.Show();
        }

        public void restart()
        {
            resultForm.Hide();
            mainForm.Show();
        }

        public void start()
        {
            mainForm.Hide();
            TestForm testForm = new TestForm(this);
            testForm.MdiParent = this;
            testForm.Show();
        }
    }

    public class FixPair
    {
        public string puzzle;
        public bool timeout;
        public int input;
        public int answer;

        public FixPair(string p, bool t, int i, int a)
        {
            puzzle = p;
            timeout = t;
            input = i;
            answer = a;
        }
    }
}
